<!-- Bojan Karlas -->	
<link href="../style.css" rel="stylesheet" type="text/css" media="screen" />

<?php

	if(isset($_GET["pol"])) $pol = $_GET["pol"];
	else $pol = "svi";
	
	if(isset($_GET["starost"])) $starost = $_GET["starost"];
	else $starost = "svi";
	
	include("konekcija_sa_bazom.php");
	mysql_query("SET NAMES utf8");
	$query = "SELECT * FROM tiplicnosti";
	
	if ($pol != "svi" || $starost != "svi") $query = $query . " WHERE ";

	if ($pol != "svi") $query = $query . "pol = '" . $pol . "'";
	
	if ($pol != "svi" && $starost != "svi") $query = $query . " AND ";
	
	if ($starost != "svi") $query = $query . "zivotnoDoba = '" . $starost . "'";
	
	$result = mysql_query($query) or die(mysql_error());
	mysql_close();
	
	//echo "Pol: $pol; Starost: $starost<br/>";
	//echo $query;
	//echo "<br/>";
	
	while ($row = mysql_fetch_array($result)) {
		echo '<div class="scroll-elem-box elemTipLic" style="height:130px; width:110px; text-align:center" id="tipLic_'. $row["idTipLicnosti"] .'">';
		
		echo '<img src="phpscripts/prikazisliku.php?id='. $row["Slika_idSlika"]. '" style="max-height: 90px; max-width: 90px" />';
		echo '<br/>';
		if (isset($row["naziv"])) echo $row["naziv"];
		else echo $row["ime"];
		echo '</div>';

	}
?>